package com.heima.kafka.sample;
/*
    
 需求描述：
 @Author: wang
 @Date: 2022/10/18 19:54
 
 */

import com.alibaba.fastjson.JSON;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class HelloListener {
    @KafkaListener(topics = "topic")
    public void onMsg(String msg){
        List list = JSON.parseObject(msg, List.class);
        System.out.println(list);
    }
}
